//
//  NativeBleNotifyDataChannel.m
//  kq_flutter_core_widget
//
//  Created by wtb on 2024/1/26.
//

#import "NativeBleNotifyDataChannel.h"

@implementation NativeBleNotifyDataChannel

#pragma mark 创建蓝牙数据通道对象
+(NativeBleNotifyDataChannel *)registerStateWithRegistrar:(NSObject<FlutterPluginRegistrar>*)registrar{
    FlutterEventChannel *dataChannel = [FlutterEventChannel eventChannelWithName:@"flutter.keqiang.com/bleNotifyEvent" binaryMessenger:[registrar messenger]];
    NativeBleNotifyDataChannel *data = [[NativeBleNotifyDataChannel alloc] init];
    [dataChannel setStreamHandler:data];
    return data;
}

- (FlutterError * _Nullable)onCancelWithArguments:(id _Nullable)arguments {
    self.eventSink = nil;
    return nil;
}

- (FlutterError * _Nullable)onListenWithArguments:(id _Nullable)arguments eventSink:(nonnull FlutterEventSink)events {
    self.eventSink = events;
    return nil;
}
@end
